package net.coding.li709.materialrefresher.model;

import lombok.Data;

/**
 * 冷却计算
 */
@Data
public class Cooling {


    /**
     * 当前冷却时间
     */
    private int currentCooling;

    public Cooling(){
    }
    
    public boolean onUpdate(){

        if(currentCooling>0){
            currentCooling--;
            return currentCooling==0;
        }
        return false;
    }
    
    public boolean isCoolingEnd(){
        return currentCooling==0;
    }

    /**
     * 开始冷却
     */
    public void startCooling(int cd){
        currentCooling= cd;
    }


}